package com.dashu.base.enums.common;


import java.util.HashMap;
import java.util.Map;

public enum GenderType {

    FEMALE("女",0),
    MALE("男",1);


    private String name;
    private int code;

    GenderType(String name,int code) {
        this.name = name;
        this.code = code;
    }

    public static GenderType getGenderType(String name) {
        switch (name) {
            case "男":
                return MALE;
            case "女":
                return FEMALE;
        }
        return null;
    }

    public static final Map<String, GenderType> map = new HashMap<>();

    static {
        for (GenderType s : GenderType.values()) {
            map.put(s.name(), s);
        }
    }
}
